<div id='sidebar'>

  <div class='panel'>
    <% if (typeof(user) !== 'undefined' || typeof(current_user) !== 'undefined') { %>
    <div class='header'>
      <span class='col_fade'>个人信息</span>
    </div>
    <div class='inner'>
      <%- partial('user/card',{ object: typeof(user) === 'undefined' ? current_user : user, as: 'user' }) %>
    </div>
    <% } else { %>
    <div class='inner'>
      <p><%= config.description %></p>

      <div>
        您可以
        <a href='/signin'>登录</a>
        或
        <a href='/signup'>注册</a>
        , 也可以
        <a href="/auth/github">
          <span class="span-info">
            通过 GitHub 登录
          </span>
        </a>
      </div>
    </div>
    <% } %>
  </div>

  <% if (typeof(current_user) !== 'undefined') { %>
  <div class="panel">
    <div class='inner'>
      <a href='/topic/create' id='create_topic_btn'>
        <span class='span-success'>发布话题</span>
      </a>
    </div>
  </div>
  <% } %>

  <% if (typeof(current_user) === 'undefined' || !current_user.isAdvanced) { %>
    <%- partial('./_ads') %>
  <% } %>

  <% if (typeof(no_reply_topics) !== 'undefined') { %>
  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>无人回复的话题</span>
    </div>
    <div class='inner'>
      <% if (no_reply_topics.length > 0) { %>
      <ul class="unstyled">
        <%- partial('topic/small', { collection: no_reply_topics, as: 'topic' }) %>
      </ul>
      <% } else { %>
      <p>无</p>
      <% } %>
    </div>
  </div>
  <% } %>

  <% if (typeof(tops) !== 'undefined') { %>
  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>积分榜</span>
      &nbsp;
      <a class='dark' href='/users/top100'>TOP 100 &gt;&gt;</a>
    </div>
    <div class='inner'>
      <% if (tops.length > 0) { %>
      <ol>
        <%- partial('user/top', { collection: tops, as: 'user' }) %>
      </ol>
      <% } else { %>
      <p>无</p>
      <% } %>
    </div>
  </div>
  <% } %>

  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>客户端二维码</span>
    </div>
    <div class='inner cnode-app-download'>
      <img width='200' src="<%- staticFile('/public/images/appdownload.png') %>">
      <br />
      <a href="https://itunes.apple.com/cn/app/id996999423" target="_blank">iOS</a>/<a href="https://fir.im/fqvr" target="_blank">Android</a>
    </div>
  </div>

  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>友情社区</span>
    </div>
    <div class='inner'>
      <ol class="friendship-community">

        <li>
          <a href="http://www.ngnice.com/?source=ionichina" target="_blank">
            <img src="<%- staticFile('/public/images/angular-small.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="https://cnodejs.org/?source=ionichina" target="_blank" title="CNode 社区">
            <img src="<%- staticFile('/public/images/cnodejs.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="https://ruby-china.org/?source=ionichina" target="_blank" title="Ruby & Rails 中文社区">
            <img src="<%- staticFile('/public/images/ruby-china-logo2.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://golangtc.com/?source=ionichina" target="_blank" title="Golangtc中国">
            <img src="<%- staticFile('/public/images/golangtc-logo2.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://phphub.org/?source=ionichina" target="_blank" title="中文 PHP & Laravel 社区">
            <img src="<%- staticFile('/public/images/phphub-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://f2e.im/?source=ionichina" target="_blank" title="F2E社区">
            <img src="<%- staticFile('/public/images/f2e-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://www.w3ctech.com/?source=ionichina" target="_blank" title="w3ctech">
            <img src="<%- staticFile('/public/images/w3cteach-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://www.hubwiz.com/?source=ionichina" target="_blank" title="汇智网">
            <img src="<%- staticFile('/public/images/hubwiz-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://www.qdjhu.com/?source=ionichina" target="_blank" title="前端江湖社区">
            <img src="<%- staticFile('/public/images/qdjhu-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://segmentfault.com/?source=ionichina" target="_blank" title="SegmentFault">
            <img src="<%- staticFile('/public/images/sf-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://testerhome.com/?source=ionichina" target="_blank" title="TesterHome">
            <img src="<%- staticFile('/public/images/testerhome-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="https://www.jpush.cn" target="_blank" title="jpush">
            <img src="<%- staticFile('/public/images/jpush-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="http://www.proginn.com" target="_blank" title="程序员客栈">
            <img src="<%- staticFile('/public/images/proginn-logo.png') %>">
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="https://www.teambition.com" target="_blank" title="Teambition">
            <img src="<%- staticFile('/public/images/teambition-logo.jpg') %>">
          </a>
        </li>
        <li>
          <a href="http://www.apicloud.com" target="_blank" title="APICloud">
            <img src="<%- staticFile('/public/images/api_cloud_logo.jpg') %>">
          </a>
        </li>


      </ol>
    </div>
  </div>



</div>
